<div class="category">
   Category
  <div  >
    <%if !@category.blank?%>
      <%= link_to "All",{:action =>"index"} %>
      <%  @category.each do |cat|%>
        <%= link_to "#{cat.title}",{:action =>"index",:cat=>"#{cat.id}"} %>
      <%end%>
    <%end%>
  </div>
</div>
<div class="clear c60">&nbsp;</div>
<div class="ballot">
  <a class="subhead">Statement</a>
  <div class="scroll">
    <%if !@statement.nil?%>
      <%@statement.each do |state|%>
        <p class="message"><%= state.message %></p>
        <p class="author">created at :<%= state.created_at %> - by :<%= state.user.login %></p>
        <p class="count">agree : <%= state.agree %> | disagree : <%= state.disagree %> </p>
      <%end%>
    <%end%>
  </div>
  <%= will_paginate @statement, :page_param => params["statement_page"]  %>
</div>
<div class="clear c25">&nbsp;</div>
<div class="ballot">
  <a class="subhead">Bad Day Story</a>
  <div class="scroll">
    <% if !@badday.nil? %>
      <% @badday.each do |bd| %>
        <p class="message"><%= bd.message %></p>
        <% if !bd.alias.nil? %>
          <p class="author">created at :<%= bd.created_at %> - by :<%=  bd.user.alias %></p>
          <p class="count">agree : <%= bd.agree %> | disagree : <%= bd.disagree %> </p>
        <%else%>
          <p class="author">created at :<%= bd.user.created_at %> - by :<%=  bd.user.login %></p>
          <p class="count">agree : <%= bd.agree %> | disagree : <%= bd.disagree %> </p>
        <%end%>
      <%end%>
    <%end%>
  </div>
  <%= will_paginate @badday, :page_param => params["badday_page"]  %>
</div>
<div class="clear c25">&nbsp;</div>
<p style="color:green;"><%= flash[:comment_ss] if flash[:comment_ss] %></p>
<p style="color:red;"><%= flash[:comment_err] if flash[:comment_err] %></p>
<div class="ballot">
  <a class="subhead">Question</a>
  <div class="scroll">
    <% if !@question.nil? %>
      <% @question.each do |q| %>
        <p class="message"><%= q.message %></p>
        <p class="author">created at :<%= q.created_at %> - by :<%= q.user.login %></p>
        <p class="count">Good question : <%= q.agree %> | Bad question : <%= q.disagree %> </p>
        <% if !q.comments.nil? %>
          <p class="comment">Comments</p>
          <% q.comments.each do |ans| %>
            <p><%= ans.message %></p>
            <p>created at :<%= ans.created_at %> - by :<%= ans.commentator %></p>
            <p><%= link_to image_tag("/images/thumb_up_off.png"),comment_vote_up_votq_path(ans.id),:class =>"up" %><%= link_to image_tag("/images/thumb_down_off.png"),comment_vote_down_votq_path(ans.id),:class =>"down" %></p>
            <p>agree : <%= ans.agree %> | disagree : <%= ans.disagree %> </p>
          <%end%>
        <%end%>
      <%end%>
    <%end%>
  </div>
  <%= will_paginate @question , :page_param => params["question_page"]%>
</div>